<template>
  <div class="child">
    <h2>我是child1组件</h2>
    <h3>我的手机:{{ phpne }}</h3>
    <button @click="handClick">把手机给老二</button>
    <button @click="jiebang">解绑不给弟弟手机</button>
  </div>
</template>

<script>

export default {
  name: 'Child',
  data() {
    return {
      phpne: '小米14pro'
    }
  },
  methods: {
    handClick() {
      this.$bus.$emit('getPhone', this.phpne)
    },
    jiebang() {
      this.$bus.$off('getPhone')
    }
  },
}
</script>

<style scoped>
.child {
  padding: 20px;
  background-color: rgb(231, 236, 153);
  box-shadow: 0 0 10px;
  margin-bottom: 15px;
}
</style>